<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="/static/plugins/font-awesome/css/font-awesome.min.css">
		<script type="text/javascript" charset="utf-8" src="/writes/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="/writes/ueditor.all.js"> </script>
		<script src="/static/js/inout/jquery-1.8.2.min.js"></script>
	</head>

	<body>
		<div style="width: 100%;">
			<legend style="width: 100%;text-align: center;font-size: 20px;">{$title}</legend>
		</div>
		<div style="margin: 15px;">
			<fieldset class="layui-elem-field">
				<div class="layui-field-box">
					{php}echo htmlspecialchars_decode($datas['ProblemContent'],ENT_QUOTES);{/php}
				</div>
			</fieldset>
			<fieldset class="layui-elem-field layui-field-title">
				<legend>详情</legend>
				<div class="layui-field-box">
					<p>创建人: <span>{$ltabe.username}</span></p>
					<p>前台域名: <span>{$ltabe.urls}</span></p>
					<p>所属平台: <span>{$ltabe.titname}</span></p>
				</div>
			</fieldset>
			<fieldset class="layui-elem-field layui-field-title">
				<legend>问题留言区</legend>
			</fieldset>
			{volist name="userdata" id="io"}
				<blockquote class="layui-elem-quote"><span>{$io.username}({$io.position})：</span>{php}echo htmlspecialchars_decode($io['Content'],ENT_QUOTES);{/php}</blockquote>
			{/volist}
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
				<legend>留言区</legend>
			</fieldset>
			<form id="odds">
				<div class="layui-inline">
					<input type="hidden" name="probid" value="{$id}"/>
					<script id="editor" type="text/plain" style="width:auto;height:500px;"></script>
				</div>
			</form>
		</div>
		<div class="layui-form-item" style="text-align: center;">
			<div class="layui-input-block">
				<button class="layui-btn" type="button" onclick="tijiao();">立即提交</button>
				<button type="button" class="layui-btn layui-btn-primary" onclick="fanhui();">返回</button>
			</div>
		</div>
		<script type="text/javascript" src="/static/plugins/layui/layui.js"></script>
		<link href="/static/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/static/webuploader/0.1.5/webuploader.min.js"></script>
		<script>
			function fanhui(){
				window.history.go(-1);
			}
			layui.use(['form', 'layedit', 'laydate'], function() {
				var form = layui.form(),
						layer = layui.layer,
						layedit = layui.layedit,
						laydate = layui.laydate;

				//创建一个编辑器
//				var editIndex = layedit.build('LAY_demo_editor');
				//自定义验证规则

				//监听提交
			});
			$(function(){
				$.fn.serializeJson=function(otherString){
					var serializeObj={},
							array=this.serializeArray();
					$(array).each(function(){
						if(serializeObj[this.name]){
							serializeObj[this.name]+=';'+this.value;
						}else{
							serializeObj[this.name]=this.value;
						}
					});

					if(otherString!=undefined){
						var otherArray = otherString.split(';');
						$(otherArray).each(function(){
							var otherSplitArray = this.split(':');
							serializeObj[otherSplitArray[0]]=otherSplitArray[1];
						});
					}
					return serializeObj;
				};
				var ue = UE.getEditor('editor');
			});
			function tijiao(){
				var data = $('#odds').serializeJson();
				$.post('/admin/problem/guestbook',{
					data:data
				},function(res){
					if(res.status===0){
						layer.msg(res.msg);
						setTimeout('location.href="/admin/problem/auxiliar?id='+"{$id}"+'"',2000);
					}else{
						layer.msg(res.msg);
					}
				});
			}
		</script>
	</body>
</html>